/*
 * Created by 岱青海蓝信息系统(北京)有限公司 on 17-7-3 下午3:58
 * Copyright (c) 2017. All rights reserved.
 */

package com.example.dqhl.jdmetro.adapter.live;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.dqhl.jdmetro.bean.live.LiveTab;

import java.util.List;

/**
 * Created by dqhl on 17/7/3.
 */
public class LiveTabAdatper extends FragmentPagerAdapter {

    private List<Fragment> mFragmentList;
    private List<LiveTab> mTabList;

    public LiveTabAdatper(FragmentManager fm, List<Fragment> fragmentList, List<LiveTab> mTabList) {
        super(fm);
        this.mFragmentList = fragmentList;
        this.mTabList = mTabList;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mTabList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTabList.get(position).getName();
    }
}
